<!--
 * @Author: your name
 * @Date: 2022-01-11 14:36:14
 * @LastEditTime: 2022-01-11 15:41:49
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \elementui\src\views\Animate.vue
-->
<template>
  <div>
    <button @click="a = !a">按钮</button>
    <transition name="fade">
      <p v-show="a">哈哈</p>
    </transition>
  </div>
</template>

<script>
export default {
  name: "Animate",
  data() {
    return {
      a: true,
    };
  },
};
</script>

<style scope>
.fade-enter-active,
.fade-leave-active {
  transition: opacity 1s;
}
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
  opacity: 0;
}
</style>